1. Field of the Invention
The present invention relates to devices and systems for reading and writing data to and from a magnetic tape, and more particularly, to a method for writing at least one datum to a magnetic tape within a predetermined distance of the tape.
2. Background Information
FIG. 1 shows a conventional tape drive 10 that communicates with a host 12. The tape drive 10 includes an interface 14 for communicating with the host 12, a controller 16 for controlling many functions of the drive 10, and a buffer 18 for storing data. The host transmits commands to the tape drive via the interface for reading and writing data. Commands transmitted by the host may be writing of data to the buffer or writing of data from the buffer to a magnetic tape 20.
The host communicates with the interface via known interface standards. For example, a communication standard employed between the host and interface may be Small Computer System Interface (SCSI). When the SCSI standard is employed, the writing of data to the buffer corresponds to a Write command and the writing of data from the buffer to the tape corresponds to a Write Filemark (Write FM) or Synchronous Request (Sync) command.
The buffer may comprise a known memory device or devices, such as a Dynamic Random Access Memory device, for storing data to be written to the tape. The buffer may be configured in a plurality of segments. The buffer may function as a ring buffer, wherein data is stored into each segment sequentially. Once data is stored in a last segment of the buffer, data received thereafter is stored in a first segment.
The tape drive may also include a head 22 for reading and writing data and reels 24 for winding the tape. A head position control system 26 is coupled to the controller and to the head for controlling the position of the head on the tape for reading and writing data.
In use, units of data, or data blocks that vary in length, are transferred from the host to a segment of the buffer. The data blocks in a segment comprise a dataset. The dataset may or may not completely consume a segment of the buffer. Once a segment is at least partially filled with a dataset, the dataset is written to the tape. If the dataset does not completely consume the segment, null or dummy data may be stored with the dataset to completely consume the segment. The writing of a dataset to the tape is referred to in the art as a “Buffer-Flush”.
The tape may not be stopped between write data commands received from the host. If there is a significant time period between write data commands, while the tape is running, there may be a substantial gap on the tape between adjacent datasets. The length of this gap may be in the order of meters and may be up to four meters or longer. Thus, to increase the recording capacity of the tape, the gap between adjacent datasets needs to be reduced.
To prevent datasets from being written to the tape beyond four meters of a preceding dataset, dummy or null datasets are written to the tape. A disadvantage of writing null datasets to the tape is that datasets containing data are not contiguous. Due to the fact that the datasets containing data are not contiguous, the original data blocks comprising the datasets cannot be reconstructed when a read request comes from the host, because the data are divided into null datasets.
A well known method for reducing the gap between adjacent datasets is a “backhitch”. Performing a backhitch requires that the tape be stopped, reversed to beyond the end of the previous synchronization, stopped again, and accelerated up to speed in the original direction by the time that the end of the previous synchronization is reached. As is understood by those of skill in the art, the backhitch process consumes a considerable amount of time, and the throughput of the tape drive may be reduced dramatically.
A technique for overcoming the disadvantage of backhitch operations is a Recursive Accumulating backhitchless Flush (RABF) operation. Generally, in an RABF operation, a controller of the tape drive first writes data in a buffer. The tape drive receives a synchronization request and the tape drive writes the data from the buffer to a temporary recording area on the tape, with the tape continuously traveling. Simultaneously, the controller recursively accumulates data in the buffer and writes back the data to a normal recording area when either the buffer or the temporary recording area becomes full. Therefore, an RABF synchronization does not need a backhitch for subsequent synchronizations and the time required for synchronization can be reduced.
An exemplary RABF is disclosed in U.S. Pat. No. 6,856,479, to Jaquette et al., and assigned to International Business Machines Corporation, Armonk, N.Y. Disclosed therein, is a controller that detects a pattern of synchronizing events for received data records to be written to tape. The controller writes each transaction data records to the magnetic tape, accumulates the synchronized transactions in a buffer, and subsequently recursively writes the accumulated transactions of data records from the buffer to the tape in a sequence. A single backhitch may be employed to place the recursively written accumulated data records following the preceding data.
Another exemplary RABF is disclosed in U.S. Pat. No. 6,865,043, to Akaku et al., assigned to International Business Machines Corporation, Armonk, N.Y. Disclosed therein, special fields for error recovery are provided in data set information tables of data sets written with synchronized transactions. If a transaction only partially fills a data set, that data set is rewritten in a succeeding data set, appending the next transaction. A moving access point in the table identifies the appended transaction, allowing the rewritten transaction to be skipped during read recovery. The table provides recovery trails by providing a thread to the data sets together, the status of the data set, and pointers, such as identifying the wrap of the immediately succeeding data set.
However, Liner Tape-Open (LTO) format tape drive specifications require that a dataset needs to be written to the tape within four meters of another dataset. LTO tape drives frequently perform a backhitch, to prevent writing of a dataset to the tape, beyond four meters of a preceding dataset. However, as discussed above, the backhitch process consumes a considerable amount of time and reduces throughput of the tape drive. Thus, many LTO Tape drives preferably use the RABF operation. However, writing performance can be deteriorated when a Sync request is received during the backhitch of an RABF operation.